package org.zoomdev.zoom.common.expression;

/**
 * 用于运算符号的比较接口
 * <p>
 * 本接口不判断数据类型和null值，必须由外部程序控制非null和数据类型的转换
 */
public class Compare {

    public static CompareValue GT = (value1, value2) -> value1.compareTo(value2) > 0;
    public static CompareValue GTE = (value1, value2) -> value1.compareTo(value2) >= 0;
    public static CompareValue LT = (value1, value2) -> value1.compareTo(value2) < 0;
    public static CompareValue LTE = (value1, value2) -> value1.compareTo(value2) <= 0;
    public static CompareValue EQ = (value1, value2) -> value1.compareTo(value2) == 0;
    public static CompareValue NEQ = (value1, value2) -> value1.compareTo(value2) != 0;

    public interface CompareValue {
        boolean compare(Comparable value1, Comparable value2);
    }


}
